# 'https://www.jinglingshuju.com/articles'
import requests
import execjs
import subprocess

headers = {

    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',
}

data = {
    'page': '2',
    'num': '20',
    'uid': 'undefined',
}

response = requests.post('https://vapi.jinglingshuju.com/Data/getNewsList', headers=headers, data=data)
res = response.json()['data']


# js_code_path = '精灵数据.js'
# # js_code_path = 'jlsj.js'
# cmd = ['node', js_code_path,res]
#
# result = subprocess.run(cmd, capture_output=True, text=True,encoding='utf-8')
# print(result.stdout)
js_compile = execjs.compile(open('jlsj.js').read())
print(js_compile.call('get_decrypt_data', res))

